/**
* @file        LocSignalDeliverManager
* @brief       
* @version     1.0.0
* @author      Changlin.Jing 
* @date        2023/2/16 17:11
* @copyright   Copyright  2022 Langge Software Co., Ltd. All rights reserved.
*/
#ifndef LANGGEBASE_LOCSIGNALDELIVERMANAGER_HPP
#define LANGGEBASE_LOCSIGNALDELIVERMANAGER_HPP

#include "ILocSignalDeliver.hpp"
#include "LocSignalDeliverChainBuilder.hpp"
//#include "Common/IPosTimerObserver.hpp"

BEGIN_SPACE_LANGE_VDR
class LocSignalDeliverManager {
public:
    explicit LocSignalDeliverManager(const WorkState &workState);

    virtual ~LocSignalDeliverManager() = default;

    void Init(const WorkState &workState);

    void UnInit();

    void OnSignal(std::shared_ptr<I_LOC_SIGNAL> posSignal);

public:
    // 添加定时器生成 POS 信号的观察者
//    void AddPosTimerObserver(vdr::IPosTimerObserver* posTimerObserver);


    std::shared_ptr<LOC_POS_SIGNAL>  GetFusionSignal(uint64_t time);

protected:
    void createSignalDeliverChain(const WorkState &workState);
    void destroySignalDeliverChain();

private:
    std::shared_ptr<ILocSignalDeliver> mSignalDeliverChain;
    std::shared_ptr<LocSignalDeliverChainBuilder> mDeliverBuilder;


};
END_SPACE_LANGE_VDR

#endif //LANGGEBASE_LOCSIGNALDELIVERMANAGER_HPP
